package com.security.test.controller;

import com.security.test.common.R;
import com.security.test.entity.LoginParameters;
import com.security.test.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private ILoginService loginService;

    @GetMapping("/hello")
    public String hello() {
        System.out.println("12321321321");
        return "HELLO WORLD";
    }

    @PostMapping("/hello2")
    public String hello2() {
        System.out.println("12321321321");
        return "HELLO WORLD";
    }

    @PostMapping("/user/login")
    public R login(@RequestBody LoginParameters parameters){
        return loginService.login();
    }
}
